package cn.humaohua.study.hadoop;

import cn.humaohua.study.hadoop.cmdrunner.c2.ncdc.MaxTemperature;
import cn.humaohua.study.hadoop.cmdrunner.c3.*;
import cn.humaohua.study.hadoop.cmdrunner.c5.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class HadoopApplication implements CommandLineRunner {
    @Autowired
    MaxTemperature maxTemperature;

    @Autowired
    ListFiles listFiles;
    @Autowired
    ReadingDataFromHadoopURL readingDataFromHadoopURL;
    @Autowired
    ReadingDataFromFileSystem readingDataFromFileSystem;
    @Autowired
    FileSystemDoubleCat fileSystemDoubleCat;//FSDataInputStream

    @Autowired
    FileCopyWithProgress fileCopyWithProgress;//将文件复制到hdfs中
    @Autowired
    FileSystemAppend fileSystemAppend;

    @Autowired
    Mkdirs mkdirs;
    @Autowired
    MkdirsByFsShell mkdirsByFsShell;
    @Autowired
    Rmr rmr;
    @Autowired
    RmrByFsShell rmrByFsShell;

    @Autowired
    FsShell2 fsShell2;
    @Autowired
    ShowFileStatusTest showFileStatusTest;
    @Autowired
    FsGlobalStatus globalStatus;

    //第五章
    @Autowired
    StreamCompressor streamCompressor;
    @Autowired
    WritableTest writableTest;
    @Autowired
    ComparableTest comparableTest;

    @Autowired
    TextIterator textIterator;

    @Autowired
    TextPairTest textPairTest;
    @Autowired
    SequenceFileWriteTest sequenceFileWriteTest;
    @Autowired
    SequenceFileReadTest sequenceFileReadTest;



    public static void main(String[] args) {
        System.out.println("===========main start===========");
        SpringApplication.run(HadoopApplication.class, args);
        System.out.println("===========main end===========");
    }

    @Override
    public void run(String... args) throws Exception {
//        maxTemperature.test();
//        listFiles.test();
//        readingDataFromHadoopURL.test();
//        readingDataFromFileSystem.test();
//        fileSystemDoubleCat.test();

//        fileCopyWithProgress.test();
//        fileSystemAppend.test();

//        mkdirs.test();
//        mkdirsByFsShell.test();
//        rmr.test();
//        rmrByFsShell.test();
//        fsShell2.test();
//        showFileStatusTest.test();
//        globalStatus.test();
//        streamCompressor.test();
//        writableTest.test();
//        comparableTest.test();

//        textIterator.test();

//        textPairTest.test();
        sequenceFileWriteTest.test();
//        sequenceFileReadTest.test();
    }
}
